package com.github.zyf.ioaj.algorithm.swarmintelligence;

import com.github.zyf.ioaj.algorithm.AbstractAlgorithm;
import com.github.zyf.ioaj.algorithm.Input;
import com.github.zyf.ioaj.constant.ParamType;
import com.github.zyf.ioaj.annotation.internal.Algorithm;
import com.github.zyf.ioaj.annotation.internal.BasicParam;

/**
 * <h1>群智能算法抽象类</h1>
 * <p>所有群只能算法都需要继承这个类</p>
 * @author zyf
 */
@Algorithm
public abstract class SwarmIntelligenceAlgorithm extends AbstractAlgorithm {

    /**
     * 群体数量
     */
    @BasicParam(type = ParamType.INT,desc = "群体数量")
    private int n;

    /**
     * 抽象算法构造函数，需要提供输入量，即提前初始化好{@link Input}对象
     *
     * @param input {@link Input}
     */
    public SwarmIntelligenceAlgorithm(Input input) {
        super(input);
        this.n = 50;
    }

    public int getN() {
        return n;
    }

    public void setN(int n) {
        this.n = n;
    }

}
